package com.alfred.springboot.handlerinterceptor.util;

import javax.servlet.http.HttpServletRequest;

/**
 * @author: alfred
 * @date: 2021/7/20
 * @description: 请求头部信息获取工具类
 */
public class HeaderUtil {

    private HeaderUtil() {
    }
    /**
     * 获取头部token信息
     * @param req 请求
     * @return token
     */
    public static String getToken(HttpServletRequest req) {
        if (req == null) {
            return null;
        }
        return req.getHeader("token");
    }
}